import 'package:flame/components.dart';

import '../entity/PlantEntity.dart';

class SeedModel {
  String image; // 图片
  Vector2 imageOffset; // 植物图片偏移
  bool isSelected; // 是否选择
  double costSunlight; // 消耗的阳光
  Vector2? initPosition; // 菜单选中位置
  String get name => plantEntity.name; // 名称
  double scaleImage; // 缩放图片
  double coldTime; // 冷却时间
  SeedPacketState seedPacketState; // 种子状态
  PlantEntity plantEntity; // 植物类型
  Vector2? dragShadowSize; // 拖动影子的大小
  Vector2? dragShadowOffset; // 拖动影子偏移位置
  Vector2? lawnCellShadowCellOffset; // 种植虚影的偏移

  SeedModel({
    required this.image,
    required this.imageOffset,
    required this.costSunlight,
    this.initPosition,
    this.scaleImage = 1,
    required this.coldTime,
    required this.plantEntity,
    this.seedPacketState = SeedPacketState.selectable,
    this.dragShadowSize,
    this.dragShadowOffset,
    this.lawnCellShadowCellOffset,
    this.isSelected = false,
  });
}

enum SeedPacketState {
  selectable, // 可选择
  draggable, // 可拖动
  disable, // 禁止操作
  cold, // 冷却中
}
